package com.example.client.utils;

import com.caucho.hessian.client.HessianProxyFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author: YAOZUN
 * @Date: Created in 19:45 2018/12/15 0015
 * @Description:
 */
public class HessianProxyFactoryUtil {

    private static Logger logger = LoggerFactory.getLogger(HessianProxyFactoryUtil.class);

    public static <T> T getHessianClientBean(Class<T> clazz,String url) throws Exception
    {
        // 客户端连接工厂,这里只是做了最简单的实例化，还可以设置超时时间，密码等安全参数
        HessianProxyFactory factory = new HessianProxyFactory();

        return (T)factory.create(clazz,url);
    }


}
